@mixin pixelize($matrix, $colors, $size) {
  $ret: "";
  $moz: "";

  @for $i from 1 through length($matrix) {
    $row: nth($matrix, $i);

    @for $j from 1 through length($row) {
      $dot: nth($row, $j);

      @if $dot != 0 {
        @if $ret != "" {
          $ret: $ret + ",";
          $moz: $moz + ",";
        }

        $color: nth($colors, $dot);
        $ret: $ret + ($j * $size) + " " + ($i * $size) + " " + $color;
        $moz: $moz + ($j * $size)+" "+ ($i * $size)+" 0 0.020em " + $color;
      }
    }
  }

  width: $size;
  height: $size;
  box-shadow: unquote($ret);
  @-moz-document url-prefix() {
    -webkit-box-shadow: unquote($moz);
  }
}
